import os
import yaml

class Config:

    """
    简单的配置类，将YAML文件内容直接映射为类属性。
    只处理第一层级，更深的层级将以字典形式存储。
    """

    config_path = None

    @classmethod
    def load_config(cls, file_path):
        # if cls.config_path is not None:
            # return
        cls.config_path = file_path
        with open(file_path, 'r', encoding='utf-8') as f:
            config_dict = yaml.safe_load(f)
        
        # 设置类属性
        for key, value in config_dict.items():
            setattr(cls, key, value)



Config.load_config('./config/config.yaml')
